<?

function get_data($url, $header = false)
{
  $ch = curl_init();
  $timeout = 5;
  curl_setopt($ch,CURLOPT_URL,$url);
  if ($header)
     curl_setopt($ch,CURLOPT_HEADER, true);

  curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
  $data = curl_exec($ch);
  curl_close($ch);
  return $data;
}

if(!function_exists('curl_init')) {
  echo "Error curl not found :(\n";
  exit(1);
}

?>